package com.oj.core.entity;

import com.oj.api.core.domain.JudgeLineInfo;
import com.oj.common.data.BaseEntity;
import lombok.*;

import javax.persistence.*;

/**
 * 题目实体
 * Created by Bing on 2018/5/4.
 */
@Entity(name = "CORE_JUDGE_LINE")
@Table(indexes = {
        @Index(name = "core_idx_code_judge_line", unique = true, columnList = "code"),
        @Index(name = "pms_idx_updatetime_judge_line", columnList = "UPDATE_TIME")
})
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class JudgeLineEntity extends BaseEntity<JudgeLineInfo>{

    /**
     * 提示
     */
    @Column(length = 2000)
    protected String remark;

    /**
     * 得分
     */
    protected Integer score;


    /**
     * 运行时间，运行内存
     */
    protected Long runTime,runMemory;

    /**
     * 评测头信息
     */
    @ManyToOne(cascade = {CascadeType.REFRESH},fetch = FetchType.LAZY)
    @JoinColumn(name = "JE_ID")
    private  JudgeEntity judgeEntity;


    @Override
    protected JudgeLineInfo createInfo() {
        return new JudgeLineInfo();
    }

    @Override
    public JudgeLineInfo buildInfo() {
        return super.buildInfo();
    }
}
